package com.aloha.common.event;

import com.aloha.po.User;
import com.aloha.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author DaiZhiHeng
 * @date 2023/7/26 20:02
 */
@Component
public class UserContext {
    private static final Map<String, User> USER_MAP = new HashMap<>();

    static {
        USER_MAP.put("1001", new User("1001", "dk1", "北京"));
        USER_MAP.put("1002", new User("1002", "dk2", "上海"));
        USER_MAP.put("1003", new User("1003", "dk3", "广州"));
        USER_MAP.put("1004", new User("1004", "dk4", "深圳"));
    }

    public User getUser(String id) {
        return USER_MAP.get(id);
    }
}

